package org.openquark.cal_Cal_Utilities_DirectedGraph;
import org.openquark.cal.internal.runtime.lecc.RTData;
import org.openquark.cal.internal.runtime.lecc.RTExecutionContext;
import org.openquark.cal.internal.runtime.lecc.RTFullApp;
import org.openquark.cal.internal.runtime.lecc.RTRecordValue;
import org.openquark.cal.internal.runtime.lecc.RTResultFunction;
import org.openquark.cal.internal.runtime.lecc.RTSupercombinator;
import org.openquark.cal.internal.runtime.lecc.RTValue;
import org.openquark.cal.runtime.CALExecutorException;
import org.openquark.cal_Cal_Core_Prelude.Append_String;
import org.openquark.cal_Cal_Core_Prelude._dict___Num___Int;
public final class _lambda__show_Directed_Graph__2 extends RTSupercombinator {
/*
* CAL data instances for literal values.
*/
private static final RTData.CAL_String $L1_String_Ref =
RTData.CAL_String.make("<ref: ");
private static final RTData.CAL_String $L2_String_N =
RTData.CAL_String.make(">\n");
/**
* Singleton instance of this class.
*/
public static final _lambda__show_Directed_Graph__2 $instance =
new _lambda__show_Directed_Graph__2();
private _lambda__show_Directed_Graph__2() {
}
public final int getArity() {
return 4;
}
public final java.lang.String getModuleName() {
return "Cal.Utilities.DirectedGraph";
}
public final java.lang.String getUnqualifiedName() {
return "$lambda$showDirectedGraph$2";
}
public final java.lang.String getQualifiedName() {
return "Cal.Utilities.DirectedGraph.$lambda$showDirectedGraph$2";
}
/**
* f
* This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.$lambda$showDirectedGraph$2
*/
public final RTValue f(final RTResultFunction $rootNode, final RTExecutionContext $ec) throws CALExecutorException {
// Arguments
RTValue vertexNum = $rootNode.getArgValue();
RTValue $currentRootNode;
RTValue accum = ($currentRootNode = $rootNode.prevArg()).getArgValue();
RTValue graph =
($currentRootNode = $currentRootNode.prevArg()).getArgValue();
RTValue $dictvarCal_Core_Debug_Show_33 =
$currentRootNode.prevArg().getArgValue();
// Release the fields in the root node to open them to garbage collection
$rootNode.clearMembers();
return
f4S(
RTValue.lastRef(
$dictvarCal_Core_Debug_Show_33,
$dictvarCal_Core_Debug_Show_33 = null),
RTValue.lastRef(graph, graph = null),
RTValue.lastRef(accum, accum = null),
RTValue.lastRef(vertexNum, vertexNum = null),
$ec);
}
/**
* f4L
* This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.$lambda$showDirectedGraph$2
*/
public final RTValue f4L(RTValue $dictvarCal_Core_Debug_Show_33, RTValue graph, RTValue accum, RTValue vertexNum, RTExecutionContext $ec) throws CALExecutorException {
return
f4S(
RTValue.lastRef(
$dictvarCal_Core_Debug_Show_33,
$dictvarCal_Core_Debug_Show_33 = null),
RTValue.lastRef(graph, graph = null),
RTValue.lastRef(accum, accum = null),
RTValue.lastRef(vertexNum, vertexNum = null),
$ec);
}
/**
* f4S
* This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.$lambda$showDirectedGraph$2
*/
public final RTValue f4S(RTValue $dictvarCal_Core_Debug_Show_33, RTValue graph, RTValue accum, RTValue vertexNum, RTExecutionContext $ec) throws CALExecutorException {
// Top level supercombinator logic
RTRecordValue $recordCase1 =
((RTRecordValue)(java.lang.Object)accum.evaluate($ec));
RTValue indent = $recordCase1.getOrdinalFieldValue(1);
RTValue text = $recordCase1.getOrdinalFieldValue(2);
if (indent.evaluate($ec).getOrdinalValue() ==
Show_Directed_Graph__base_Indent__2.$instance.f1S(
_dict___Num___Int.$instance,
$ec).evaluate(
$ec).getOrdinalValue()) {
return accum;
} else {
return
RTRecordValue.makeTupleRecord(
new RTValue[] {indent, new RTFullApp.General._2._L(Append_String.$instance, text, new RTFullApp.General._2._L(Append_String.$instance, new RTFullApp.General._1._S(Show_Directed_Graph__make_Indent_String__4.$instance, indent), new RTFullApp.General._2._L(Append_String.$instance, _lambda__show_Directed_Graph__2.$L1_String_Ref, new RTFullApp.General._2._L(Append_String.$instance, $dictvarCal_Core_Debug_Show_33.apply(new RTFullApp.General._2._S(Get_Vertex.$instance, graph, vertexNum)), _lambda__show_Directed_Graph__2.$L2_String_N))))});
}
}
}